import {$axios, Sevent} from "../request.js";
import prefix from "../base.js";

export default {
    // 获取请假状态
    getAskLeaveStatus() {
        return Sevent({
            url: `${prefix.askLeave}/status`
        })
        // return $axios(`${prefix.path}${prefix.askLeave}/list`, data)
    },
    // 获取请假配置
    getAskLeaveConfig() {
        return Sevent({
            url: `${prefix.askLeave}/config`
        })
    },
    // 请假
    doAskLeave(data) {
        return $axios(`${prefix.askLeave}/`, data, "POST");
    },
    // 取消请假
    cancelAskLeave(recordId) {
        return $axios(`${prefix.askLeave}/cancel?recordId=${recordId}`, null, 'POST');
    },
    // 结束休假
    endAskLeave(recordId) {
        return $axios(`${prefix.askLeave}/end?recordId=${recordId}`, null, 'POST');
    },
};
